package com.ymatou.iapi.godmch.testcase;

import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.common.collect.Lists;
import com.ymatou.iapi.activitymanage.service.returnProductActivityStockCall;
import com.ymatou.iapi.godmch.parameter.CreateCodeBean;
import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.parameter.createagentBean;
import com.ymatou.iapi.godmch.parameter.registerByCodeBean;
import com.ymatou.iapi.godmch.parameter.setConditionMarkupConfigBean;
import com.ymatou.iapi.godmch.service.CreateCodeCall;
import com.ymatou.iapi.godmch.service.applyAgentCall;
import com.ymatou.iapi.godmch.service.applySupplierCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymatou.iapi.godmch.service.createagentCall;
import com.ymatou.iapi.godmch.service.registerByCodeCall;
import com.ymatou.iapi.godmch.service.setConditionMarkupConfigCall;
import com.ymatou.mq.admin.parameter.MessageListBean;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.MqQueryCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.mapping.godmch.markup_config_conditionMapper;
import com.ymttest.database.model.agent_type;
import com.ymttest.database.model.godmch.markup_config_condition;
import com.ymttest.database.model.godmch.markup_config_conditionExample;
import com.ymttest.database.sqlwapper.godmch.agent_typeWapper;
import com.ymttest.database.sqlwapper.godmch.markup_config_conditionWapper;
import com.ymttest.utils.TestDataManager;
/**
*设置按条件自动加价规则
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_setConditionMarkupConfig{
	private static setConditionMarkupConfigBean bean;
	private static setConditionMarkupConfigCall call;
	private MqQueryCallService mqQueryCallService=new MqQueryCallService();
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("设置按条件自动加价规则");
	}

	@Before
	public void caseUp() {
		bean=new setConditionMarkupConfigBean();
		call=new setConditionMarkupConfigCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void updateTimeConfig() throws InterruptedException
	{
		   //修改update_time 因为相同的agentid+suppelierId 1分钟内无法修改
		   markup_config_conditionWapper markupConfig=new markup_config_conditionWapper();
		   markup_config_conditionExample example=new markup_config_conditionExample();
		   example.createCriteria().andAgent_idEqualTo(bean.getAgentId()).andSupplier_idEqualTo(bean.getSupplierId());
		   markup_config_condition config=markupConfig.selectByExample(example).get(0);
		   config.setUpdate_time(Date.from((LocalDateTime.now().plusDays(-1).atZone(ZoneId.systemDefault()).toInstant())));
		   markupConfig.updateByPrimaryKey(config);
	}
	
	private markup_config_condition selectConfig() throws InterruptedException
	{
		markup_config_conditionWapper markupConfig=new markup_config_conditionWapper();
		markup_config_conditionExample example=new markup_config_conditionExample();
		example.createCriteria().andAgent_idEqualTo(bean.getAgentId()).andSupplier_idEqualTo(bean.getSupplierId());
		example.setOrderByClause(" create_time desc");
		markup_config_condition config=markupConfig.selectByExample(example).get(0);
		return config;
	}
    /**
     * 校验数据库
     * @param Condition_type
     * @param lstStr
     * @throws InterruptedException
     */
	private void check_verify(Integer Condition_type,String lstStr) throws InterruptedException {
		
		markup_config_condition config=selectConfig();
		
		Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
		Logger.verifyEquals(Condition_type, config.getCondition_type(), "验证数据库markup_config_condition表中的Condition_type字段与传入的一致");
		Logger.verifyEquals(bean.getMarkupType(), config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
		Logger.verifyEquals(bean.getPercentage().stripTrailingZeros().toPlainString(), config.getPercentage().stripTrailingZeros().toPlainString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
		Logger.verifyEquals(bean.getDecimalType(), config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");
		
		Logger.verifyEquals(bean.getOnSaleType(), config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");
		Logger.verifyEquals(bean.getRefreshProduct(), config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");
		Logger.verifyEquals(0, config.getConfig_status(), "验证数据库markup_config_condition表中的Config_status字段与传入的一致");
		Logger.verifyEquals(lstStr, config.getCondition_list(), "验证数据库markup_config_condition表中的Condition_list字段与传入的一致");
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_001() {
		Logger.start(true,"设置按条件自动加价规则-品牌没重复-返回成功");
		try {

           Integer agentId=GodmchManageCallService.createAgent();
           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
			
            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
		    //品牌
		    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			call.setData(bean);
			call.callService();	
			String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
			check_verify(5,str);
			
			//验证发消息总线-新增
	        MessageListBean messageListBean=mqQueryCallService.initGodmchManage(String.valueOf(bean.getAgentId()), "set_markupconfig");
	        List <Map> mq=mqQueryCallService.GetMqMessage(messageListBean);
	        if(mq.size()==0){
				Thread.sleep(5000);
				mq = MqQueryCallService.GetMqMessage(messageListBean);
			}
	        Logger.verifyEquals(bean.getAgentId(),mq.get(0).get("agentId"), "验证消息总线代理Id AgentId");
	        Logger.verifyEquals(bean.getSupplierId(),mq.get(0).get("supplierId"), "验证消息总线服务商 SupplierId");
	        Logger.verifyEquals(1,mq.get(0).get("operateType"), "验证消息总线operateType=1新增自动加价");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_002() {
		Logger.start(true,"设置按条件自动加价规则-品牌重复-返回失败");
		try {
	           Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	           bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				call.callService();	
			
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_setConditionMarkupConfig_002_1() {
		Logger.start(true,"设置按条件自动加价规则-自动继承模式的代理商，不可设置自动加价-返回失败");
		try {
//			createIndepMchBean createBean=GodmchManageCallService.InitCreateIndepMchBean();
//			createIndepMchCall createCall=GodmchManageCallService.CreateIndepMchCall(createBean);
//			Integer mchId=createCall.getmchId();
//			//邀请码
//			CreateCodeBean createCodeBean=GodmchManageCallService.InitcreateCodeBeanForAgent(mchId, true);
//			
//			
//			//供货商
////			createIndepMchBean createIndepMchBean=GodmchManageCallService.InitCreateIndepMchBean();
////	        createIndepMchCall createIndepMchCall=GodmchManageCallService.CreateIndepMchCall(createIndepMchBean);
//	        applySupplierBean applySupplierBean=GodmchManageCallService.initApplySupplier(createCall.getmchId());
//	        applySupplierCall applySupplierCall=GodmchManageCallService.applySupplierCall(applySupplierBean);
//			GodmchManageCallService.approveSupplier(createCall.getmchId(),applySupplierCall.getSupplierId());
//			
//			
//			
//			// 创建代理类型
//						createagentBean createagentBean = GodmchManageCallService.InitCreateAgentTypeBean(applySupplierCall.getSupplierId());
//						createagentBean.setAgentMode(2);
//						createagentCall createagentcall = GodmchManageCallService.CreateAgentTypeCall(createagentBean);
//						
//						//查询类型
//						agent_typeWapper agentTypewapper = new agent_typeWapper();
//						Map<String, Object> map = new HashMap();
//						map.put("mchId", mchId);
//						List<agent_type> agenttypeList = agentTypewapper.selectby(map);
//						createCodeBean.setRoleType(agenttypeList.get(1).getAgentType());
//						
//						CreateCodeCall createCodeCall=GodmchManageCallService.createCodeCall(createCodeBean);
//						registerByCodeBean registerByCodeBean=GodmchManageCallService.initRegisterByCode(applySupplierCall.getSupplierId(), createCodeCall.getCode());
//						registerByCodeBean.setAppKey("appsqSeller_" + mchId);
//						registerByCodeCall registerByCodeCall=GodmchManageCallService.registerByCodeCall(registerByCodeBean);
							
//	       Integer agentId=mchId;
//			// Integer agentId=registerByCodeCall.getRegMchId();
//	        Integer supplierId=applySupplierCall.getSupplierId();
	        
	        Integer agentId=501186784;
	        Integer supplierId=501186785;
	         bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			   //品牌
			 bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			 call.setData(bean);
			 call.callService();		
			 Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
			  
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_003() {
		Logger.start(true,"设置按条件自动加价规则-分类没重复-返回成功");
		try {
		       Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				String str="{\"category\":["+bean.getCategoryList().get(0)+"]}";
				check_verify(6,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_004() {
		Logger.start(true,"设置按条件自动加价规则-分类重复-返回失败");
		try {
		       Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
				call.callService();	
			
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
				 
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_005() {
		Logger.start(true,"设置按条件自动加价规则-仓库没重复-返回成功");
		try {
		       Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				String str="{\"depot\":["+bean.getDepotList().get(0)+"]}";
				check_verify(7,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_006() {
		Logger.start(true,"设置按条件自动加价规则-仓库重复-返回失败");
		try {
		       Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();		
				call.callService();	
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_007() {
		Logger.start(true,"设置按条件自动加价规则-仓库+分类都不存在-返回成功");
		try {
		       Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
			
				String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(4,str);	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_008() {
		Logger.start(true,"设置按条件自动加价规则-仓库+分类,仓库存在,分类不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	           bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setBrandList(null);
			   //品牌
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   call.setData(bean);
			   call.callService();	
			   //修改时间
			   updateTimeConfig();
				
			  //第二次执行 仓库存在,分类不存在
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   call.setData(bean);
			   call.callService();			
			
			 String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			 check_verify(4,str);	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_009() {
		Logger.start(true,"设置按条件自动加价规则-仓库+分类,仓库不存在,分类存在-返回成功");
		try {
			
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	           bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setBrandList(null);
			   //品牌
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   call.setData(bean);
			   call.callService();	
			   //修改时间
			   updateTimeConfig();
			   
			  //第二次执行 仓库不存在,分类存在
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   call.setData(bean);
			   call.callService();			
			
			 String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			 check_verify(4,str);				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_010() {
		Logger.start(true,"设置按条件自动加价规则-仓库+分类都存在-返回失败");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	           bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setBrandList(null);
			   //品牌
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   call.setData(bean);
			   call.callService();	
			   Thread.sleep(2000);
			   call.callService();
			   Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
			   
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_011() {
		Logger.start(true,"设置按条件自动加价规则-仓库+品牌都不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_012() {
		Logger.start(true,"设置按条件自动加价规则-仓库+品牌,仓库存在,品牌不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
				//修改时间
				updateTimeConfig();
			   //第二次执行 仓库存在,品牌不存在
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();		
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_013() {
		Logger.start(true,"设置按条件自动加价规则-仓库+品牌,仓库不存在,品牌存在-返回成功");
		try {
			
		    Integer agentId=GodmchManageCallService.createAgent();
            Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
			
            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
            bean.setBrandList(null);
		    //品牌
		    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
		    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			call.setData(bean);
			call.callService();			
			//修改时间
			updateTimeConfig();
		   //第二次执行 仓库存在,品牌不存在
		    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			call.setData(bean);
			call.callService();		
			String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			check_verify(3,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_014() {
		Logger.start(true,"设置按条件自动加价规则-仓库+品牌都存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();		
				call.callService();	
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_015() {
		Logger.start(true,"设置按条件自动加价规则-分类+品牌都不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
				check_verify(2,str);	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_016() {
		Logger.start(true,"设置按条件自动加价规则-分类+品牌,分类存在,品牌不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行 分类存在,品牌不存在
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
				check_verify(2,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_017() {
		Logger.start(true,"设置按条件自动加价规则-分类+品牌,分类不存在,品牌存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行 分类不存在,品牌存在
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
				check_verify(2,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_018() {
		Logger.start(true,"设置按条件自动加价规则-分类+品牌都存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setBrandList(null);
			    //品牌
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();		
				call.callService();	
			
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_019() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库都不存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();			
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_020() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,品牌分类不存在,仓库存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_021() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,分类仓库不存在,品牌存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			   // bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_022() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,分类品牌不存在,仓库存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_023() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,品牌不存在,分类仓库存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    //bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_024() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,仓库不存在,分类品牌存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			    //bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_025() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,分类不存在,仓库品牌存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				//第二次执行
			  //  bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
			
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_026() {
		Logger.start(true,"设置按条件自动加价规则-品牌+分类+仓库,分类仓库品牌都存在-返回失败");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				//修改时间
				updateTimeConfig();
				call.callService();	
				Logger.verifyEquals("5000", call.getStatusCode1(), "验证status");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_027() {
		Logger.start(true,"设置按条件自动加价规则-加价类型,1按比例加价");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setMarkupType(1);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
				check_verify(5,str);
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_028() {
		Logger.start(true,"设置按条件自动加价规则-加价类型,2");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setMarkupType(2);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
				Logger.verifyEquals(2, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
				Logger.verifyEquals("0", config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
				Logger.verifyEquals(0, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_029() {
		Logger.start(true,"设置按条件自动加价规则-加价类型,3不加价");
		try {
			 Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setMarkupType(3);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
				Logger.verifyEquals(3, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
				Logger.verifyEquals("0", config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
				Logger.verifyEquals(0, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_030() {
		Logger.start(true,"设置按条件自动加价规则-加价后小数点类型1精确到个位数");
		try {
			
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setDecimalType(1);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(1, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_031() {
		Logger.start(true,"设置按条件自动加价规则-加价后小数点类型2保留小数点后1位");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setDecimalType(2);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(2, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_032() {
		Logger.start(true,"设置按条件自动加价规则-加价后小数点类型3保留小数点后2位");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setDecimalType(3);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(3, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_033() {
		Logger.start(true,"设置按条件自动加价规则-上架类型1自动添加到我的店");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setOnSaleType(1);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(1, config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_034() {
		Logger.start(true,"设置按条件自动加价规则-上架类型2手动上架到我的店");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setOnSaleType(2);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(2, config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_035() {
		Logger.start(true,"设置按条件自动加价规则-覆盖已添加的商品价格");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setRefreshProduct(true);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(true, config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_setConditionMarkupConfig_036() {
		Logger.start(true,"设置按条件自动加价规则-不覆盖已添加的商品价格");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				
	            bean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setRefreshProduct(false);
			    //品牌
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
				call.setData(bean);
				call.callService();	
				
				markup_config_condition config=selectConfig();
				Logger.verifyEquals(false, config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}